package com.css.fxfzypg.manage.lethalitydifference.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.css.fxfzypg.manage.lethalitydifference.repository.entity.LethalityDifferenceEntity;
import com.css.fxfzypg.manage.lethalitydifference.vo.LethalityDifferenceParams;
import com.google.gson.JsonArray;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

public interface LethalityDifferenceService {

    boolean saveDataByTask(String taskCode,String taskName,String taskDistrict) throws UnsupportedEncodingException;

    boolean save(LethalityDifferenceEntity lethalityDifferenceEntity) throws UnsupportedEncodingException;

    Map<String, Object> querySubmitOrNot(String submitFlag, String taskCode, int curPage, int pageSize);

    boolean updateIsSubmit(Map<String, String> map);

    JSONObject queryData(String id);

    Map<String, Object> queryDataList(HttpServletRequest request, LethalityDifferenceParams lethalityDifferenceParams, int curPage, int pageSize);

    Map<String,Object> updateIsAdopt(Map<String,String> map);

    boolean modifyLethalityDifference(LethalityDifferenceEntity lethalityDifferenceEntity);

    boolean saveAndSubmit(LethalityDifferenceEntity lethalityDifferenceEntity) throws UnsupportedEncodingException;

    boolean modifyAndSubmit(LethalityDifferenceEntity lethalityDifferenceEntity);

    boolean deleteById(String id);

    Map<String, Object> queryPutDataList(HttpServletRequest request, LethalityDifferenceParams lethalityDifferenceParams, int curPage, int pageSize);

    JSONObject getDataById(String id);

    boolean addWeightValue(Map<String, Object> map);

    Map<Object, Object> createFinalValue(String taskDistrict, String taskNum) throws UnsupportedEncodingException;

    boolean saveAndSubmitPC(LethalityDifferenceEntity lethalityDifferenceEntity) throws UnsupportedEncodingException;

    boolean deleteCustomIndicatorById(String id);

    Map<String, Object> uploadLethalityDifference(MultipartFile file) throws Exception;

    void exportLethalityDifference(HttpServletResponse response, LethalityDifferenceParams lethalityDifferenceParams);

    List<LethalityDifferenceEntity> getFinalValue(String taskId) throws UnsupportedEncodingException;

    /**
     * 任务结束前调用  校验是否采纳
     * @param taskId
     * @return
     * @throws UnsupportedEncodingException
     */
    Map<String,Object> checkIsAdopted(String taskId) throws UnsupportedEncodingException;

    /**
     * 任务结束时调用  进行入库校验
     * @param taskNum
     * @return
     */
    JSONArray checkPutLethalityDifference(String taskNum);

    /**
     * 任务结束时调用  入库校验通过,且没有返回数据
     * @param taskNum
     * @return
     */
    boolean updateIsAdoptByTaskNum(String taskNum);


    /**
     * 更新状态(将已入库改为已采纳,已采纳改为已入库)
     */
    boolean updateIsAdoptById(String rkId,String cnId);

    /**
     * 设定地震中页面加载时调用,获取是否生成区县致死性差异性分析标识
     * @param taskId
     * @return
     */
    String getCreateFlag(String taskId) ;

    Map<String, Object> appQuerySubmitOrNot(String submitFlag, String taskCode, int curPage, int pageSize,String userId);
}
